﻿
using System;
using System.Collections.Generic;
 
using System.Text;
using System.Runtime.InteropServices;

namespace HDF5
{

    using hid_t = System.Int32;
    using herr_t = System.Int32;
    using hsize_t = System.UInt64;
    using hssize_t = System.Int64;
    using hunsigned = System.UInt32;

    using hbool_t = System.UInt32;
    using htri_t = System.Int32;
    using ssize_t = System.Int64;

    using haddr_t = System.UInt64;

    using uint32_t = System.UInt32;
    using uint64_t = System.UInt64;

    using H5O_msg_crt_idx_t = System.UInt32;

    using size_t = System.UInt32;

    using off_t = System.Int32;

    using H5E_major_t = System.Int32;
    using H5E_minor_t = System.Int32;

    using time_t = System.Int64;
    using H5Z_filter_t = System.Int32;  


    #region enums

    /* These are the various classes of datatypes */
    /* If this goes over 16 types (0-15), the file format will need to change) */
    public enum H5T_class_t
    {
        H5T_NO_CLASS = -1,  /*error                                      */
        H5T_INTEGER = 0,   /*integer types                              */
        H5T_FLOAT = 1,   /*floating-point types                       */
        H5T_TIME = 2,   /*date and time types                        */
        H5T_STRING = 3,   /*character string types                     */
        H5T_BITFIELD = 4,   /*bit field types                            */
        H5T_OPAQUE = 5,   /*opaque types                               */
        H5T_COMPOUND = 6,   /*compound types                             */
        H5T_REFERENCE = 7,   /*reference types                            */
        H5T_ENUM = 8,	/*enumeration types                          */
        H5T_VLEN = 9,	/*Variable-Length types                      */
        H5T_ARRAY = 10,	/*Array types                                */

        H5T_NCLASSES                /*this must be last                          */
    }

    public enum H5T_order_t
    {
        H5T_ORDER_ERROR = -1,  /*error                                      */
        H5T_ORDER_LE = 0,   /*little endian                              */
        H5T_ORDER_BE = 1,   /*bit endian                                 */
        H5T_ORDER_VAX = 2,   /*VAX mixed endian                           */
        H5T_ORDER_NONE = 3    /*no particular order (strings, bits,..)     */
        /*H5T_ORDER_NONE must be last */
    }

    public enum H5T_sign_t
    {
        H5T_SGN_ERROR = -1,  /*error                                      */
        H5T_SGN_NONE = 0,   /*this is an unsigned type                   */
        H5T_SGN_2 = 1,   /*two's complement                           */

        H5T_NSGN = 2    /*this must be last!                         */
    }

    public enum H5T_norm_t
    {
        H5T_NORM_ERROR = -1,  /*error                                      */
        H5T_NORM_IMPLIED = 0,   /*msb of mantissa isn't stored, always 1     */
        H5T_NORM_MSBSET = 1,   /*msb of mantissa is always 1                */
        H5T_NORM_NONE = 2    /*not normalized                             */
        /*H5T_NORM_NONE must be last */
    }

    public enum H5T_cset_t
    {
        H5T_CSET_ERROR = -1,  /*error                                      */
        H5T_CSET_ASCII = 0,   /*US ASCII                                   */
        H5T_CSET_UTF8 = 1,   /*UTF-8 Unicode encoding		     */
        H5T_CSET_RESERVED_2 = 2,   /*reserved for later use		     */
        H5T_CSET_RESERVED_3 = 3,   /*reserved for later use		     */
        H5T_CSET_RESERVED_4 = 4,   /*reserved for later use		     */
        H5T_CSET_RESERVED_5 = 5,   /*reserved for later use		     */
        H5T_CSET_RESERVED_6 = 6,   /*reserved for later use		     */
        H5T_CSET_RESERVED_7 = 7,   /*reserved for later use		     */
        H5T_CSET_RESERVED_8 = 8,   /*reserved for later use		     */
        H5T_CSET_RESERVED_9 = 9,   /*reserved for later use		     */
        H5T_CSET_RESERVED_10 = 10,  /*reserved for later use		     */
        H5T_CSET_RESERVED_11 = 11,  /*reserved for later use		     */
        H5T_CSET_RESERVED_12 = 12,  /*reserved for later use		     */
        H5T_CSET_RESERVED_13 = 13,  /*reserved for later use		     */
        H5T_CSET_RESERVED_14 = 14,  /*reserved for later use		     */
        H5T_CSET_RESERVED_15 = 15   /*reserved for later use		     */
    }

    public enum H5T_str_t
    {
        H5T_STR_ERROR = -1,  /*error                                      */
        H5T_STR_NULLTERM = 0,   /*null terminate like in C                   */
        H5T_STR_NULLPAD = 1,   /*pad with nulls                             */
        H5T_STR_SPACEPAD = 2,   /*pad with spaces like in Fortran            */
        H5T_STR_RESERVED_3 = 3,   /*reserved for later use		     */
        H5T_STR_RESERVED_4 = 4,   /*reserved for later use		     */
        H5T_STR_RESERVED_5 = 5,   /*reserved for later use		     */
        H5T_STR_RESERVED_6 = 6,   /*reserved for later use		     */
        H5T_STR_RESERVED_7 = 7,   /*reserved for later use		     */
        H5T_STR_RESERVED_8 = 8,   /*reserved for later use		     */
        H5T_STR_RESERVED_9 = 9,   /*reserved for later use		     */
        H5T_STR_RESERVED_10 = 10,  /*reserved for later use		     */
        H5T_STR_RESERVED_11 = 11,  /*reserved for later use		     */
        H5T_STR_RESERVED_12 = 12,  /*reserved for later use		     */
        H5T_STR_RESERVED_13 = 13,  /*reserved for later use		     */
        H5T_STR_RESERVED_14 = 14,  /*reserved for later use		     */
        H5T_STR_RESERVED_15 = 15   /*reserved for later use		     */
    }

    public enum H5T_pad_t
    {
        H5T_PAD_ERROR = -1,  /*error                                      */
        H5T_PAD_ZERO = 0,   /*always set to zero                         */
        H5T_PAD_ONE = 1,   /*always set to one                          */
        H5T_PAD_BACKGROUND = 2,   /*set to background value                    */

        H5T_NPAD = 3    /*THIS MUST BE LAST                          */
    }

    public enum H5T_cmd_t
    {
        H5T_CONV_INIT = 0,	/*query and/or initialize private data	     */
        H5T_CONV_CONV = 1, 	/*convert data from source to dest datatype */
        H5T_CONV_FREE = 2	/*function is being removed from path	     */
    }

    public enum H5T_bkg_t
    {
        H5T_BKG_NO = 0, 	/*background buffer is not needed, send NULL */
        H5T_BKG_TEMP = 1,	/*bkg buffer used as temp storage only       */
        H5T_BKG_YES = 2	/*init bkg buf with data before conversion   */
    }

    /* Conversion function persistence */
    public enum H5T_pers_t {
        H5T_PERS_DONTCARE	= -1, 	/*wild card				     */
        H5T_PERS_HARD	= 0,	/*hard conversion function		     */
        H5T_PERS_SOFT	= 1 	/*soft conversion function		     */
    } 

    /* The order to retrieve atomic native datatype */
    public enum H5T_direction_t {
        H5T_DIR_DEFAULT     = 0,    /*default direction is inscendent            */
        H5T_DIR_ASCEND      = 1,    /*in inscendent order                        */
        H5T_DIR_DESCEND     = 2     /*in descendent order                        */
    }  

    /* The exception type passed into the conversion callback function */
    public enum H5T_conv_except_t {
        H5T_CONV_EXCEPT_RANGE_HI       = 0,   /*source value is greater than destination's range */
        H5T_CONV_EXCEPT_RANGE_LOW      = 1,   /*source value is less than destination's range    */
        H5T_CONV_EXCEPT_PRECISION      = 2,   /*source value loses precision in destination      */
        H5T_CONV_EXCEPT_TRUNCATE       = 3,   /*source value is truncated in destination         */
        H5T_CONV_EXCEPT_PINF           = 4,   /*source value is positive infinity(floating number) */
        H5T_CONV_EXCEPT_NINF           = 5,   /*source value is negative infinity(floating number) */
        H5T_CONV_EXCEPT_NAN            = 6    /*source value is NaN(floating number)             */
    }  

    /* The return value from conversion callback function H5T_conv_except_func_t */
    public enum H5T_conv_ret_t {
        H5T_CONV_ABORT      = -1,   /*abort conversion                           */
        H5T_CONV_UNHANDLED  = 0,    /*callback function failed to handle the exception      */
        H5T_CONV_HANDLED    = 1     /*callback function handled the exception successfully  */
    }  


    
    #endregion enums

#region structs
    public struct H5T_cdata_t
    {
        H5T_cmd_t command; /*what should the conversion function do?    */
        H5T_bkg_t need_bkg; /*is the background buffer needed?	     */
        hbool_t recalc;	/*recalculate private data		     */
        IntPtr priv;	/*private data				     */
    }

    /* Variable Length Datatype struct in memory */
    /* (This is only used for VL sequences, not VL strings, which are stored in char *'s) */
    public struct hvl_t
    {
        size_t len; /* Length of VL data (in base type units) */
        IntPtr p;    /* Pointer to VL data */
    } 
#endregion structs

    #region delegates
    /* All datatype conversion functions are... */
    public delegate herr_t H5T_conv_t(hid_t src_id, hid_t dst_id, ref H5T_cdata_t cdata, size_t nelmts, size_t buf_stride, size_t bkg_stride, 
    IntPtr buf, IntPtr bkg, hid_t dset_xfer_plist);

    /* Exception handler.  If an exception like overflow happenes during conversion,
     * this function is called if it's registered through H5Pset_type_conv_cb.
     */
    public delegate H5T_conv_ret_t H5T_conv_except_func_t(H5T_conv_except_t except_type,
        hid_t src_id, hid_t dst_id, IntPtr src_buf, IntPtr dst_buf, IntPtr user_data);

    #endregion delegates

    public static class H5T
    {


        public static size_t H5T_VARIABLE = unchecked((size_t)(-1));
        public static size_t H5T_OPAQUE_TAG_MAX = 256;
         
        /*
         * The IEEE floating point types in various byte orders.
         */
        public static hid_t H5T_IEEE_F32BE;
        public static hid_t H5T_IEEE_F32LE;//		(H5OPEN H5T_IEEE_F32LE_g)
        public static hid_t H5T_IEEE_F64BE;//		(H5OPEN H5T_IEEE_F64BE_g)
        public static hid_t H5T_IEEE_F64LE;//		(H5OPEN H5T_IEEE_F64LE_g)

        /*
         * These are "standard" types.  For instance, signed (2's complement) and
         * unsigned integers of various sizes and byte orders.
         */
        public static hid_t H5T_STD_I8BE;//		(H5OPEN H5T_STD_I8BE_g)
        public static hid_t H5T_STD_I8LE;//		(H5OPEN H5T_STD_I8LE_g)
        public static hid_t H5T_STD_I16BE;//		(H5OPEN H5T_STD_I16BE_g)
        public static hid_t H5T_STD_I16LE;//		(H5OPEN H5T_STD_I16LE_g)
        public static hid_t H5T_STD_I32BE;//		(H5OPEN H5T_STD_I32BE_g)
        public static hid_t H5T_STD_I32LE;//		(H5OPEN H5T_STD_I32LE_g)
        public static hid_t H5T_STD_I64BE;//		(H5OPEN H5T_STD_I64BE_g)
        public static hid_t H5T_STD_I64LE;//		(H5OPEN H5T_STD_I64LE_g)
        public static hid_t H5T_STD_U8BE;//		(H5OPEN H5T_STD_U8BE_g)
        public static hid_t H5T_STD_U8LE;//		(H5OPEN H5T_STD_U8LE_g)
        public static hid_t H5T_STD_U16BE;//		(H5OPEN H5T_STD_U16BE_g)
        public static hid_t H5T_STD_U16LE;//		(H5OPEN H5T_STD_U16LE_g)
        public static hid_t H5T_STD_U32BE;//		(H5OPEN H5T_STD_U32BE_g)
        public static hid_t H5T_STD_U32LE;//		(H5OPEN H5T_STD_U32LE_g)
        public static hid_t H5T_STD_U64BE;//		(H5OPEN H5T_STD_U64BE_g)
        public static hid_t H5T_STD_U64LE;//		(H5OPEN H5T_STD_U64LE_g)
        public static hid_t H5T_STD_B8BE;//		(H5OPEN H5T_STD_B8BE_g)
        public static hid_t H5T_STD_B8LE;//		(H5OPEN H5T_STD_B8LE_g)
        public static hid_t H5T_STD_B16BE;//		(H5OPEN H5T_STD_B16BE_g)
        public static hid_t H5T_STD_B16LE;//		(H5OPEN H5T_STD_B16LE_g)
        public static hid_t H5T_STD_B32BE;//		(H5OPEN H5T_STD_B32BE_g)
        public static hid_t H5T_STD_B32LE;//		(H5OPEN H5T_STD_B32LE_g)
        public static hid_t H5T_STD_B64BE;//		(H5OPEN H5T_STD_B64BE_g)
        public static hid_t H5T_STD_B64LE;//		(H5OPEN H5T_STD_B64LE_g)
        public static hid_t H5T_STD_REF_OBJ;//	        (H5OPEN H5T_STD_REF_OBJ_g)
        public static hid_t H5T_STD_REF_DSETREG;//     (H5OPEN H5T_STD_REF_DSETREG_g)

        /*
         * Types which are particular to Unix.
         */
        public static hid_t H5T_UNIX_D32BE;//		(H5OPEN H5T_UNIX_D32BE_g)
        public static hid_t H5T_UNIX_D32LE;//		(H5OPEN H5T_UNIX_D32LE_g)
        public static hid_t H5T_UNIX_D64BE;//		(H5OPEN H5T_UNIX_D64BE_g)
        public static hid_t H5T_UNIX_D64LE;//		(H5OPEN H5T_UNIX_D64LE_g)

        /*
         * Types particular to the C language.  String types use `bytes' instead
         * of `bits' as their size.
         */
        public static hid_t H5T_C_S1;//		(H5OPEN H5T_C_S1_g)

        /*
         * Types particular to Fortran.
         */
        public static hid_t H5T_FORTRAN_S1;//		(H5OPEN H5T_FORTRAN_S1_g)

        /*
         * These types are for Intel CPU's.  They are little endian with IEEE
         * floating point.
         */
        public static hid_t H5T_INTEL_I8 =		H5T_STD_I8LE;
        public static hid_t H5T_INTEL_I16 =		H5T_STD_I16LE;
        public static hid_t H5T_INTEL_I32 =		H5T_STD_I32LE;
        public static hid_t H5T_INTEL_I64 =		H5T_STD_I64LE;
        public static hid_t H5T_INTEL_U8 =		H5T_STD_U8LE;
        public static hid_t H5T_INTEL_U16 =		H5T_STD_U16LE;
        public static hid_t H5T_INTEL_U32 =		H5T_STD_U32LE;
        public static hid_t H5T_INTEL_U64 =		H5T_STD_U64LE;
        public static hid_t H5T_INTEL_B8 =		H5T_STD_B8LE;
        public static hid_t H5T_INTEL_B16 =		H5T_STD_B16LE;
        public static hid_t H5T_INTEL_B32 =		H5T_STD_B32LE;
        public static hid_t H5T_INTEL_B64 =		H5T_STD_B64LE;
        public static hid_t H5T_INTEL_F32 =		H5T_IEEE_F32LE;
        public static hid_t H5T_INTEL_F64 =		H5T_IEEE_F64LE;

        /*
         * These types are for DEC Alpha CPU's.  They are little endian with IEEE
         * floating point.
         */
        public static hid_t H5T_ALPHA_I8 =		H5T_STD_I8LE;
        public static hid_t H5T_ALPHA_I16 =		H5T_STD_I16LE;
        public static hid_t H5T_ALPHA_I32 =		H5T_STD_I32LE;
        public static hid_t H5T_ALPHA_I64 =		H5T_STD_I64LE;
        public static hid_t H5T_ALPHA_U8 =		H5T_STD_U8LE;
        public static hid_t H5T_ALPHA_U16 =		H5T_STD_U16LE;
        public static hid_t H5T_ALPHA_U32 =		H5T_STD_U32LE;
        public static hid_t H5T_ALPHA_U64 =		H5T_STD_U64LE;
        public static hid_t H5T_ALPHA_B8 =		H5T_STD_B8LE;
        public static hid_t H5T_ALPHA_B16 =		H5T_STD_B16LE;
        public static hid_t H5T_ALPHA_B32 =		H5T_STD_B32LE;
        public static hid_t H5T_ALPHA_B64 =		H5T_STD_B64LE;
        public static hid_t H5T_ALPHA_F32 =		H5T_IEEE_F32LE;
        public static hid_t H5T_ALPHA_F64 =		H5T_IEEE_F64LE;

        /*
         * These types are for MIPS cpu's commonly used in SGI systems. They are big
         * endian with IEEE floating point.
         */
        public static hid_t H5T_MIPS_I8	=	H5T_STD_I8BE;
        public static hid_t H5T_MIPS_I16 =		H5T_STD_I16BE;
        public static hid_t H5T_MIPS_I32 =		H5T_STD_I32BE;
        public static hid_t H5T_MIPS_I64 =		H5T_STD_I64BE;
        public static hid_t H5T_MIPS_U8	 =	H5T_STD_U8BE;
        public static hid_t H5T_MIPS_U16 =		H5T_STD_U16BE;
        public static hid_t H5T_MIPS_U32 =		H5T_STD_U32BE;
        public static hid_t H5T_MIPS_U64 =		H5T_STD_U64BE;
        public static hid_t H5T_MIPS_B8	 =	H5T_STD_B8BE;
        public static hid_t H5T_MIPS_B16 =		H5T_STD_B16BE;
        public static hid_t H5T_MIPS_B32 =		H5T_STD_B32BE;
        public static hid_t H5T_MIPS_B64 =		H5T_STD_B64BE;
        public static hid_t H5T_MIPS_F32 =		H5T_IEEE_F32BE;
        public static hid_t H5T_MIPS_F64 =		H5T_IEEE_F64BE;

        /*
         * The VAX floating point types (i.e. in VAX byte order)
         */
        public static hid_t H5T_VAX_F32	;//	(H5OPEN H5T_VAX_F32_g)
        public static hid_t H5T_VAX_F64;//		(H5OPEN H5T_VAX_F64_g)

        /*
         * The predefined native types. These are the types detected by H5detect and
         * they violate the naming scheme a little.  Instead of a class name,
         * precision and byte order as the last component, they have a C-like type
         * name.  If the type begins with `U' then it is the unsigned version of the
         * integer type; other integer types are signed.  The type LLONG corresponds
         * to C's `long long' and LDOUBLE is `long double' (these types might be the
         * same as `LONG' and `DOUBLE' respectively).
         */
       // public static hid_t H5T_NATIVE_CHAR		(CHAR_MIN?H5T_NATIVE_SCHAR:H5T_NATIVE_UCHAR)
        public static hid_t H5T_NATIVE_SCHAR;//        (H5OPEN H5T_NATIVE_SCHAR_g)
        public static hid_t H5T_NATIVE_UCHAR ;//       (H5OPEN H5T_NATIVE_UCHAR_g)
        public static hid_t H5T_NATIVE_CHAR		= H5T_NATIVE_UCHAR;
        public static hid_t H5T_NATIVE_SHORT;//        (H5OPEN H5T_NATIVE_SHORT_g)
        public static hid_t H5T_NATIVE_USHORT;//       (H5OPEN H5T_NATIVE_USHORT_g)
        public static hid_t H5T_NATIVE_INT;//          (H5OPEN H5T_NATIVE_INT_g)
        public static hid_t H5T_NATIVE_UINT;//         (H5OPEN H5T_NATIVE_UINT_g)
        public static hid_t H5T_NATIVE_LONG;//         (H5OPEN H5T_NATIVE_LONG_g)
        public static hid_t H5T_NATIVE_ULONG;//        (H5OPEN H5T_NATIVE_ULONG_g)
        public static hid_t H5T_NATIVE_LLONG;//        (H5OPEN H5T_NATIVE_LLONG_g)
        public static hid_t H5T_NATIVE_ULLONG;//       (H5OPEN H5T_NATIVE_ULLONG_g)
        public static hid_t H5T_NATIVE_FLOAT;//        (H5OPEN H5T_NATIVE_FLOAT_g)
        public static hid_t H5T_NATIVE_DOUBLE;//       (H5OPEN H5T_NATIVE_DOUBLE_g)
        
        public static hid_t H5T_NATIVE_LDOUBLE;//	(H5OPEN H5T_NATIVE_LDOUBLE_g)
        
        public static hid_t H5T_NATIVE_B8;//		(H5OPEN H5T_NATIVE_B8_g)
        public static hid_t H5T_NATIVE_B16;//		(H5OPEN H5T_NATIVE_B16_g)
        public static hid_t H5T_NATIVE_B32;//		(H5OPEN H5T_NATIVE_B32_g)
        public static hid_t H5T_NATIVE_B64;//		(H5OPEN H5T_NATIVE_B64_g)
        public static hid_t H5T_NATIVE_OPAQUE;//       (H5OPEN H5T_NATIVE_OPAQUE_g)
        public static hid_t H5T_NATIVE_HADDR;//	(H5OPEN H5T_NATIVE_HADDR_g)
        public static hid_t H5T_NATIVE_HSIZE;//	(H5OPEN H5T_NATIVE_HSIZE_g)
        public static hid_t H5T_NATIVE_HSSIZE;//	(H5OPEN H5T_NATIVE_HSSIZE_g)
        public static hid_t H5T_NATIVE_HERR;//		(H5OPEN H5T_NATIVE_HERR_g)
        public static hid_t H5T_NATIVE_HBOOL;//	(H5OPEN H5T_NATIVE_HBOOL_g)

        /* C9x integer types */
        public static hid_t H5T_NATIVE_INT8	;//		(H5OPEN H5T_NATIVE_INT8_g)
        public static hid_t H5T_NATIVE_UINT8;//		(H5OPEN H5T_NATIVE_UINT8_g)
        public static hid_t H5T_NATIVE_INT_LEAST8;//		(H5OPEN H5T_NATIVE_INT_LEAST8_g)
        public static hid_t H5T_NATIVE_UINT_LEAST8;//		(H5OPEN H5T_NATIVE_UINT_LEAST8_g)
        public static hid_t H5T_NATIVE_INT_FAST8 ;//		(H5OPEN H5T_NATIVE_INT_FAST8_g)
        public static hid_t H5T_NATIVE_UINT_FAST8;//		(H5OPEN H5T_NATIVE_UINT_FAST8_g)

        public static hid_t H5T_NATIVE_INT16;//		(H5OPEN H5T_NATIVE_INT16_g)
        public static hid_t H5T_NATIVE_UINT16;//		(H5OPEN H5T_NATIVE_UINT16_g)
        public static hid_t H5T_NATIVE_INT_LEAST16;//		(H5OPEN H5T_NATIVE_INT_LEAST16_g)
        public static hid_t H5T_NATIVE_UINT_LEAST16;//		(H5OPEN H5T_NATIVE_UINT_LEAST16_g)
        public static hid_t H5T_NATIVE_INT_FAST16;//		(H5OPEN H5T_NATIVE_INT_FAST16_g)
        public static hid_t H5T_NATIVE_UINT_FAST16;//		(H5OPEN H5T_NATIVE_UINT_FAST16_g)

        public static hid_t H5T_NATIVE_INT32;//		(H5OPEN H5T_NATIVE_INT32_g)
        public static hid_t H5T_NATIVE_UINT32;//		(H5OPEN H5T_NATIVE_UINT32_g)
        public static hid_t H5T_NATIVE_INT_LEAST32;//		(H5OPEN H5T_NATIVE_INT_LEAST32_g)
        public static hid_t H5T_NATIVE_UINT_LEAST32;//		(H5OPEN H5T_NATIVE_UINT_LEAST32_g)
        public static hid_t H5T_NATIVE_INT_FAST32;//		(H5OPEN H5T_NATIVE_INT_FAST32_g)
        public static hid_t H5T_NATIVE_UINT_FAST32;//		(H5OPEN H5T_NATIVE_UINT_FAST32_g)

        public static hid_t H5T_NATIVE_INT64;//		(H5OPEN H5T_NATIVE_INT64_g)
        public static hid_t H5T_NATIVE_UINT64;//		(H5OPEN H5T_NATIVE_UINT64_g)
        public static hid_t H5T_NATIVE_INT_LEAST64;//		(H5OPEN H5T_NATIVE_INT_LEAST64_g)
        public static hid_t H5T_NATIVE_UINT_LEAST64;// 	(H5OPEN H5T_NATIVE_UINT_LEAST64_g)
        public static hid_t H5T_NATIVE_INT_FAST64;//		(H5OPEN H5T_NATIVE_INT_FAST64_g)
        public static hid_t H5T_NATIVE_UINT_FAST64;//		(H5OPEN H5T_NATIVE_UINT_FAST64_g)

        static H5T()
        {
            int status = H5.H5open();
            IntPtr hdl = LoadLibrary("hdf5dll.dll");
            if (hdl == IntPtr.Zero)
            {
                throw new Exception("Failed to load hdf5dll.dll dll library!");
            }

            H5T_IEEE_F32BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_IEEE_F32BE_g"));
            H5T_IEEE_F32LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_IEEE_F32LE_g"));
            H5T_IEEE_F64BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_IEEE_F64BE_g"));
            H5T_IEEE_F64LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_IEEE_F64LE_g"));

            H5T_STD_I8BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_I8BE_g"));
            H5T_STD_I8LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_I8LE_g"));
            H5T_STD_I16BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_I16BE_g"));
            H5T_STD_I16LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_I16LE_g"));
            H5T_STD_I32BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_I32BE_g"));
            H5T_STD_I32LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_I32LE_g"));
            H5T_STD_I64BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_I64BE_g"));
            H5T_STD_I64LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_I64LE_g"));
            H5T_STD_U8BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_U8BE_g"));
            H5T_STD_U8LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_U8LE_g"));
            H5T_STD_U16BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_U16BE_g"));
            H5T_STD_U16LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_U16LE_g"));
            H5T_STD_U32BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_U32BE_g"));
            H5T_STD_U32LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_U32LE_g"));
            H5T_STD_U64BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_U64BE_g"));
            H5T_STD_U64LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_U64LE_g"));
            H5T_STD_B8BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_B8BE_g"));
            H5T_STD_B8LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_B8LE_g"));
            H5T_STD_B16BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_B16BE_g"));
            H5T_STD_B16LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_B16LE_g"));
            H5T_STD_B32BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_B32BE_g"));
            H5T_STD_B32LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_B32LE_g"));
            H5T_STD_B64BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_B64BE_g"));
            H5T_STD_B64LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_B64LE_g"));
            H5T_STD_REF_OBJ = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_REF_OBJ_g"));
            H5T_STD_REF_DSETREG = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_STD_REF_DSETREG_g"));

            H5T_UNIX_D32BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_UNIX_D32BE_g"));
            H5T_UNIX_D32LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_UNIX_D32LE_g"));
            H5T_UNIX_D64BE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_UNIX_D64BE_g"));
            H5T_UNIX_D64LE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_UNIX_D64LE_g"));

            H5T_C_S1 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_C_S1_g"));

            H5T_FORTRAN_S1 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_FORTRAN_S1_g"));

            H5T_VAX_F32 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_VAX_F32_g"));
            H5T_VAX_F64 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_VAX_F64_g"));

            H5T_NATIVE_SCHAR = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_SCHAR_g"));
            H5T_NATIVE_UCHAR = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_UCHAR_g"));
            H5T_NATIVE_SHORT = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_SHORT_g"));
            H5T_NATIVE_USHORT = Marshal.ReadInt32(GetProcAddress(hdl,  "H5T_NATIVE_USHORT_g"));
            H5T_NATIVE_INT = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_INT_g"));
            H5T_NATIVE_UINT = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_UINT_g"));
            H5T_NATIVE_LONG = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_LONG_g"));
            H5T_NATIVE_ULONG = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_ULONG_g"));
            H5T_NATIVE_LLONG = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_LLONG_g"));
            H5T_NATIVE_ULLONG = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_ULLONG_g"));
            H5T_NATIVE_FLOAT = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_FLOAT_g"));
            H5T_NATIVE_DOUBLE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_DOUBLE_g"));
            H5T_NATIVE_LDOUBLE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_LDOUBLE_g"));
            H5T_NATIVE_B8 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_B8_g"));
            H5T_NATIVE_B16 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_B16_g"));
            H5T_NATIVE_B32 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_B32_g"));
            H5T_NATIVE_B64 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_B64_g"));
            H5T_NATIVE_OPAQUE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_OPAQUE_g"));
            H5T_NATIVE_HADDR = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_HADDR_g"));
            H5T_NATIVE_HSIZE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_HSIZE_g"));
            H5T_NATIVE_HSSIZE = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_HSSIZE_g"));
            H5T_NATIVE_HERR = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_HERR_g"));
            H5T_NATIVE_HBOOL = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_HBOOL_g"));

            H5T_NATIVE_INT8 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_INT8_g"));
            H5T_NATIVE_UINT8 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_UINT8_g"));
            H5T_NATIVE_INT_LEAST8 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_INT_LEAST8_g"));
            H5T_NATIVE_UINT_LEAST8 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_UINT_LEAST8_g"));
            H5T_NATIVE_INT_FAST8 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_INT_FAST8_g"));
            H5T_NATIVE_UINT_FAST8 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_UINT_FAST8_g"));

            H5T_NATIVE_INT16 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_INT16_g"));
            H5T_NATIVE_UINT16 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_UINT16_g"));
            H5T_NATIVE_INT_LEAST16 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_INT_LEAST16_g"));
            H5T_NATIVE_UINT_LEAST16 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_UINT_LEAST16_g"));
            H5T_NATIVE_INT_FAST16 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_INT_FAST16_g"));
            H5T_NATIVE_UINT_FAST16 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_UINT_FAST16_g"));

            H5T_NATIVE_INT32 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_INT32_g"));
            H5T_NATIVE_UINT32 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_UINT32_g"));
            H5T_NATIVE_INT_LEAST32 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_INT_LEAST32_g"));
            H5T_NATIVE_UINT_LEAST32 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_UINT_LEAST32_g"));
            H5T_NATIVE_INT_FAST32 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_INT_FAST32_g"));
            H5T_NATIVE_UINT_FAST32 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_UINT_FAST32_g"));

            H5T_NATIVE_INT64 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_INT64_g"));
            H5T_NATIVE_UINT64 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_UINT64_g"));
            H5T_NATIVE_INT_LEAST64 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_INT_LEAST64_g"));
            H5T_NATIVE_UINT_LEAST64 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_UINT_LEAST64_g"));
            H5T_NATIVE_INT_FAST64 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_INT_FAST64_g"));
            H5T_NATIVE_UINT_FAST64 = Marshal.ReadInt32(GetProcAddress(hdl, "H5T_NATIVE_UINT_FAST64_g"));

            bool isFreed = FreeLibrary(hdl);
        }




#region General Datatype Operations

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern  hid_t H5Topen( hid_t loc_id, [In][MarshalAs(UnmanagedType.LPStr)] string name ) ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern hid_t H5Topen2( hid_t loc_id, [In][MarshalAs(UnmanagedType.LPStr)] string name, hid_t tapl_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tcommit( hid_t loc_id, [In][MarshalAs(UnmanagedType.LPStr)] string name, hid_t dtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern hid_t H5Tcommit( hid_t loc_id, [In][MarshalAs(UnmanagedType.LPStr)] string name, hid_t dtype_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tcommit2( hid_t loc_id, [In][MarshalAs(UnmanagedType.LPStr)] string name, hid_t dtype_id, hid_t lcpl_id, hid_t tcpl_id, hid_t tapl_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tcommit_anon( hid_t loc_id, hid_t dtype_id, hid_t tcpl_id, hid_t tapl_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern htri_t H5Tcommitted( hid_t dtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern hid_t H5Tcopy( hid_t dtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern htri_t H5Tequal( hid_t dtype_id1, hid_t dtype_id2 )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tlock( hid_t dtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern H5T_class_t H5Tget_class( hid_t dtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern hid_t H5Tget_create_plist( hid_t dtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern  size_t H5Tget_size( hid_t dtype_id ) ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern  hid_t H5Tget_super( hid_t dtype_id ) ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern hid_t H5Tget_native_type( hid_t dtype_id, H5T_direction_t direction )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern htri_t H5Tdetect_class( hid_t dtype_id, H5T_class_t dtype_class )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tclose( hid_t dtype_id )  ;

#endregion General Datatype Operations

#region Conversion Functions
        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tconvert( hid_t src_id, hid_t dst_id, size_t nelmts, IntPtr buf, IntPtr background, hid_t plist_id )  ;

        //[DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        //public static extern  H5T_conv_t H5Tfind(hid_t src_id, hid_t dst_id,  H5T_cdata_t[] pcdata ) ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern htri_t H5Tcompiler_conv(hid_t src_id, hid_t dst_id)  ;

        //[DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        //public static extern herr_t H5Tregister( H5T_pers_t type, [In][MarshalAs(UnmanagedType.LPStr)] string name, hid_t src_id, hid_t dst_id, H5T_conv_t func )  ;

        //[DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        //public static extern herr_t H5Tunregister( H5T_pers_t type, const char *name, hid_t src_id, hid_t dst_id, H5T_conv_t func )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern hid_t H5Tdecode (IntPtr buf)  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tencode(hid_t obj_id, IntPtr buf, out size_t nalloc)  ;

#endregion Conversion Functions

#region Atomic Datatype Properties
        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tset_size( hid_t dtype_id, size_t size )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern H5T_order_t H5Tget_order( hid_t dtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern  herr_t H5Tset_order( hid_t dtype_id, H5T_order_t order ) ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern size_t H5Tget_precision( hid_t dtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tset_precision( hid_t dtype_id, size_t precision )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern int H5Tget_offset( hid_t dtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tset_offset( hid_t dtype_id, size_t offset )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tget_pad( hid_t dtype_id, out H5T_pad_t  lsb, out H5T_pad_t  msb )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tset_pad( hid_t dtype_id, H5T_pad_t lsb, H5T_pad_t msb )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern H5T_sign_t H5Tget_sign( hid_t dtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tset_sign( hid_t dtype_id, H5T_sign_t sign )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tget_fields( hid_t dtype_id, out size_t spos, out size_t epos,out size_t esize,out  size_t mpos, out size_t msize )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tset_fields( hid_t dtype_id, size_t spos, size_t epos, size_t esize, size_t mpos, size_t msize )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern size_t H5Tget_ebias( hid_t dtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tset_ebias( hid_t dtype_id, size_t ebias )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern H5T_norm_t H5Tget_norm( hid_t dtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tset_norm( hid_t dtype_id, H5T_norm_t norm )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern H5T_pad_t H5Tget_inpad( hid_t dtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tset_inpad( hid_t dtype_id, H5T_pad_t inpad )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern H5T_cset_t H5Tget_cset( hid_t dtype_id )  ;
        
        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern  herr_t H5Tset_cset( hid_t dtype_id, H5T_cset_t cset ) ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern H5T_str_t H5Tget_strpad( hid_t dtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tset_strpad( hid_t dtype_id, H5T_str_t strpad )  ;

#endregion Atomic Datatype Properties

#region Array Datatypes
        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern hid_t H5Tarray_create( hid_t base_type_id, int rank, [In] hsize_t[] dims,[In] int[] perm )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern hid_t H5Tarray_create( hid_t base_typ_id, hunsigned rank, [In] hsize_t[] dims ) ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern hid_t H5Tarray_create2( hid_t base_type_id, hunsigned rank, [In] hsize_t[] dims)  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern int H5Tget_array_ndims( hid_t adtype_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern  int H5Tget_array_dims( hid_t adtype_id, [Out]hsize_t[] dims, [Out]int[] perm ) ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern int H5Tget_array_dims( hid_t adtype_id, [Out]hsize_t[] dims ) ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern  int H5Tget_array_dims2( hid_t adtype_id, [Out]hsize_t[] dims ) ;

#endregion  Array Datatypes

#region Compound Datatype Properties
        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern int H5Tget_nmembers( hid_t dtype_id )   ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern H5T_class_t H5Tget_member_class( hid_t cdtype_id, hunsigned member_no )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern string H5Tget_member_name( hid_t dtype_id, hunsigned field_idx )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern int H5Tget_member_index( hid_t dtype_id, [In][MarshalAs(UnmanagedType.LPStr)] string field_name )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern size_t H5Tget_member_offset( hid_t dtype_id, hunsigned memb_no )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern hid_t H5Tget_member_type( hid_t dtype_id, hunsigned field_idx )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tinsert( hid_t dtype_id, [In][MarshalAs(UnmanagedType.LPStr)] string name, size_t offset, hid_t field_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern  herr_t H5Tpack( hid_t dtype_id ) ;

#endregion Compound Datatype Properties

#region Variable-length Datatypes
        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern hid_t H5Tvlen_create( hid_t base_type_id )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern  htri_t H5Tis_variable_str( hid_t dtype_id ) ;

#endregion Variable-length Datatypes

#region Opaque Datatypes
        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tset_tag( hid_t dtype_id ,[In][MarshalAs(UnmanagedType.LPStr)] string tag ) ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern string H5Tget_tag( hid_t dtype_id )  ;
#endregion Opaque Datatypes

#region Enumeration Datatypes
        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern hid_t H5Tenum_create( hid_t dtype_id ) ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern  herr_t H5Tenum_insert( hid_t dtype_id, [In][MarshalAs(UnmanagedType.LPStr)] string name, IntPtr value ) ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tenum_nameof( hid_t dtype_id, IntPtr value, StringBuilder name, size_t size )  ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern  herr_t H5Tenum_valueof( hid_t dtype_id, StringBuilder name, IntPtr value ) ;

        [DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        public static extern herr_t H5Tget_member_value( hid_t dtype_id, hunsigned memb_no, IntPtr value )  ;

        //already defined
        //[DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        //public static extern int H5Tget_nmembers( hid_t dtype_id )  ;

        //already defined
        //[DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        //public static extern string H5Tget_member_name( hid_t dtype_id, hunsigned field_idx )  ;

        //already defined
        //[DllImport("hdf5dll.dll",CharSet=CharSet.Ansi)]
        //public static extern int H5Tget_member_index( hid_t dtype_id, [In][MarshalAs(UnmanagedType.LPStr)] string field_name )  ;

#endregion Enumeration Datatypes

         #region kernel32 functions
        [DllImport("kernel32.dll", SetLastError = true)]
        private static extern IntPtr GetProcAddress(IntPtr hModule, string procName);

        [DllImport("kernel32.dll", SetLastError = true)]
        private static extern IntPtr LoadLibrary(string lpszLib);

        [DllImport("kernel32", SetLastError = true)]
        private static extern bool FreeLibrary(IntPtr handle);
        #endregion kernel32 functions

    }
}
